class Solution {
    public:
        bool isPalindrome(int x) {
            vector<int>num;
            if(x>0){
                while(x){
                    int a=x%10;
                    x/=10;
                    num.push_back(a);
                }
                int l=0;
                int r=num.size()-1;
                while(l<=r){
                    if(num[l]!=num[r]){
                        return false;
                    }
                    l++;
                    r--;
                }
                return true;
            }else if(x<0){
                return false;
            }else{
                return true;
            }
        }
    };